package utils;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class ExtensionFileFilter extends FileFilter {

	String mDescription;

	String mExtension;

	public ExtensionFileFilter(String aDescription, String aExtension) {
		mDescription = aExtension;
		mExtension = aExtension;
		mExtension.toLowerCase();
	}

	public String getDescription() {
		return mDescription;
	}

	public boolean accept(File file) {
		if (file.isDirectory()) {
			return true;
		} else {
			String path = file.getAbsolutePath().toLowerCase();

			if ((path.endsWith(mExtension) )) {
				return true;
			}
		}
		return false;
	}

}
